<template>
    <div class="enter-work-index text-default">
        <Header></Header>
        <div class="enter-work-wrapper">
            <ul class="menu">
                <li v-for="(item, index) in menuList" :key="index"
                    :class="{'active': setActive(item.key) }"
                    @click="$router.push({name: item.key})">
                    <i :class="`icon ${item.icon}`"/>
                    {{ item.name }}
                </li>
            </ul>
            <div class="enter-work-content">
                <router-view/>
            </div>
        </div>
        <Footer></Footer>
    </div>
</template>
<script>
import Footer from '@/views/components/header/footer'
import Header from '@/views/components/header/header'
// import pagination from "@/mixins/pagination";

export default {
    name: 'enterpriseWorkIndex',
    // mixins: [pagination],
    components: {
        Footer,
        Header
    },
    data() {
        return {
            menuList: [
                {icon: 'icon-1', name: '企业中心', key: 'enterpriseWorkCenter'},
                {icon: 'icon-3', name: '职位管理', key: 'enterpriseWorkJob'},
                {icon: 'icon-2', name: '简历管理', key: 'enterpriseWorkResume'},
                {icon: 'icon-5', name: '账号管理', key: 'enterpriseWorkAccount'},
                {icon: 'icon-5', name: '消息沟通', key: 'enterpriseWorkChat'},
            ]
        }
    },
    created() {
    },
    methods: {
        setActive(key) {
            const routeName = this.$route.name
            if ((this.$route.meta.parent && this.$route.meta.parent === key) || routeName === key) {
                return true
            }

        }
    }
}
</script>
<style lang="scss">
@import "../../../assets/styles/enterprise/base";
@import "../../../assets/styles/enterprise/common.css";

.enter-work-index {
    .header {
        position: inherit;
        .top {
            background: #3B4D66;
        }
        .nav {
            background: #435772;
        }
    }
    .enter-work-wrapper {
        width: 1200px;
        margin: 40px auto;
        display: flex;
        justify-content: flex-start;

        .menu {
            width: 210px;
            height: 380px;
            background: #FFF;
            padding: 20px 20px 20px 0;

            li:last-child {
                margin-bottom: 0;
            }

            li {
                font-size: 16px;
                font-weight: 400;
                line-height: 24px;
                cursor: pointer;
                border-left: 4px solid #FFF;
                padding-left: 15px;
                margin-bottom: 20px;
                display: flex;
                align-items: center;

                &:hover {
                    color: $text-blue;
                }

                .icon {
                    display: inline-block;
                    height: 20px;
                    width: 20px;
                    margin-right: 10px;

                    &.edit {
                        background: url('../../../assets/image/enterprise/edit.png') no-repeat;
                        background-size: 100% 100%;
                    }

                    &.icon-1 {
                        background: url(../../../assets/image/icon-1.png) no-repeat;
                        background-size: 100% 100%;
                    }

                    &.icon-2 {
                        background: url(../../../assets/image/icon-2.png) no-repeat;
                        background-size: 100% 100%;
                    }

                    &.icon-3 {
                        background: url(../../../assets/image/icon-3.png) no-repeat;
                        background-size: 100% 100%;
                    }

                    &.icon-4 {
                        background: url(../../../assets/image/icon-4.png) no-repeat;
                        background-size: 100% 100%;
                    }

                    &.icon-5 {
                        background: url(../../../assets/image/icon-5.png) no-repeat;
                        background-size: 100% 100%;
                    }

                    &.icon-6 {
                        background: url(../../../assets/image/icon-6.png) no-repeat;
                        background-size: 100% 100%;
                    }

                }

                &.active, &:hover {
                    color: $text-blue;
                    border-left: 4px solid $text-blue;

                    .icon-1 {
                        background: url(../../../assets/image/icon-1-ac.png) no-repeat;
                        background-size: 100% 100%;
                    }

                    .icon-2 {
                        background: url(../../../assets/image/icon-2-ac.png) no-repeat;
                        background-size: 100% 100%;
                    }

                    .icon-3 {
                        background: url(../../../assets/image/icon-3-ac.png) no-repeat;
                        background-size: 100% 100%;
                    }

                    .icon-4 {
                        background: url(../../../assets/image/icon-4-ac.png) no-repeat;
                        background-size: 100% 100%;
                    }

                    .icon-5 {
                        background: url(../../../assets/image/icon-5-ac.png) no-repeat;
                        background-size: 100% 100%;
                    }

                    .icon-6 {
                        background: url(../../../assets/image/icon-6-ac.png) no-repeat;
                        background-size: 100% 100%;
                    }
                }
            }
        }
    }

    .enter-work-content {
        flex: 1 1;
        margin-left: 15px;
    }

    .enterprise-table {
        .actions-bar {
            margin-bottom: 10px;
        }

        .table-content {
            min-height: 300px;
        }

        .table-pagination {
            margin-top: 15px;
            margin-bottom: 15px;
            text-align: center;
        }
    }

    .enterprise-tag {
        color: $text-blue;
        border-left: 4px solid $text-blue;
        padding-left: 10px;
    }

    .el-tabs__item {
        color: $text-default;
    }

    .el-tabs__item.is-active {
        color: $text-blue;
    }

    .el-form-item__label {
        color: $text-default;
    }

    .el-tabs__active-bar {
        background-color: $text-blue;
    }

    .el-tabs__nav-wrap::after {
        background-color: #E8E8E8;
        height: 1px;
    }
}
</style>
